<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="com.sz.announce.dao.IAnnounceDAO" %>
<%@ page import="com.sz.common.SZUtility" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

ServletContext servletContext = request.getSession().getServletContext(); 
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);

IAnnounceDAO dao = (IAnnounceDAO) context.getBean("AnnounceDAO");

String strShow = "";
List list = dao.queryAnnounce_seatingShow();
	for(Iterator it=list.iterator();it.hasNext();)
		{
			Map mapTemp=(Map)it.next();
			strShow += "<a onclick=\"onShow('"
			+ SZUtility.toString(mapTemp.get("ANNOUNCE_SEATING_ID"))
			+ "')\" style='cursor:hand;' />"
			+ SZUtility.toString(mapTemp.get("TITLE"))
			+ "                   </a>";
		
					//strShow += SZUtility.toString(mapTemp.get("TITLE")) ;
				
		}

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登陆系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="login">
	<meta http-equiv="description" content="系统登陆界面">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  	<form name="login_form" action="/otprj/login.do" method="post" onsubmit="return login_check(username,password)">  	
  	  <table width="100%" height="42px" border="0" cellpadding="0" cellspacing="0">
  		  <tr>
  		    <td style="text-align:left">
  		    <img src="img/head1.bmp" />
  		    </td>
  
  		    
	      	<td style="text-align:left" width="600px">
	      		<marquee onmouseout="this.start();" scrollamount="3" onmouseover="this.stop();">
  		   	 		 <%=strShow%>
	   	 		</marquee>
  		    </td>

    		<td style="text-align:right">
  		          用户: <%=session.getAttribute("username")%>
  		    </td>
  		    
  		    <td style="text-align:right">
  		    <input type="button" value="主菜单" onclick="onClick('../mainmenu.do')">
  		    </td>
  		    
		    <td style="text-align:right">

		    <input type="button" value="注销" onclick="onClick('../logout.do')">
  		    </td>
  		  </tr>
  		  </table>
  	</form> 
  	
 		<SCRIPT LANGUAGE="JavaScript">
  		function onClick(action) {
  			window.parent.location.href = action;
  		}
  	
	 	function onShow(id){
		 	url = "<%=path%>";
  			url += "/announce/showAnnounce_seating.do?ANNOUNCE_SEATING_ID="+id+"";  			
  			var param = "status:no;scroll:no;dialogWidth:600px;dialogHeight:400px";
			window.showModalDialog(url, window, param);
 		}
  	  </SCRIPT>	
  </body>
</html>
